<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateCouponServiceTypeTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('coupon_service_type', function (Blueprint $table) {
            $table->integer('coupon_id', false, true)->comment('优惠券ID');
            $table->integer('service_type_id', false, true)->comment('服务类型ID');

            $table->primary(['coupon_id', 'service_type_id']);
        });

        \DB::statement("ALTER TABLE `coupon_service_type` comment '优惠券服务类型关联表'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('coupon_service_type');
    }
}
